# coding: utf-8
from PySide6.QtGui import QPalette, QColor
from PySide6.QtWidgets import QApplication


def get_system_color() -> QColor:
    """
    Returns the system color.
    """
    return QApplication.palette().color(QPalette.ColorRole.Window)


def isDarkTheme() -> bool:
    """
    Returns True if the system color is dark, False otherwise.
    """
    palette = QApplication.palette()
    return palette.color(QPalette.ColorRole.WindowText).lightness() > palette.color(
        QPalette.ColorRole.Window).lightness()


def themeColor():
    return QColor('#862e9c')
